package com.liugai.lgeachday.request;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Properties;

public class StatusMessage {
    private final static Properties statusProperty = new Properties();

    public final static String getHttpStatusMsg(int status) {
        String property = statusProperty.getProperty(String.valueOf(status));
        if (property == null) {
            return "状态码不存在";
        }
        return property;
    }

    static {
        ClassLoader classLoader = StatusMessage.class.getClassLoader();
        try {
            InputStream stream = classLoader.getResourceAsStream("request/status-code-message.properties");
            statusProperty.load(new InputStreamReader(stream));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
